﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Vowei.Service;
using System.Web.Caching;

namespace Vowei.Test.Library
{
    public class ServiceMockHttpContext : IServiceHttpContext
    {
        public ServiceMockHttpContext()
        {
            Cache = new ServiceMockHttpCache();
        }

        public string ApplicationPath
        {
            get { return "/"; }
        }

        public IServiceHttpCache Cache
        {
            get;
            private set;
        }
    }

    public class ServiceMockHttpCache : IServiceHttpCache
    {
        public int Count
        {
            get { return 0; }
        }

        public long EffectivePercentagePhysicalMemoryLimit
        {
            get { return 0L; }
        }

        public long EffectivePrivateBytesLimit
        {
            get { return 0L; }
        }

        public object this[string key]
        {
            get
            {
                return null;
            }
            set
            {
            }
        }

        public object Add(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
        {
            return null;
        }

        public object Get(string key)
        {
            return null;
        }

        public void Insert(string key, object value)
        {
        }

        public void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
        {
        }

        public object Remove(string key)
        {
            return null;
        }
    }

}
